package com.flca.frw.util
{
	import mx.collections.ArrayCollection;
	import mx.utils.StringUtil;
	import mx.formatters.DateFormatter;
	import mx.rpc.Fault;
	
	import com.flca.frw.model.ExceptionInfo;
	import com.flca.frw.model.ExceptionDetailInfo;
	
	public class PrintUtil 
	{
		public static const SEP_ARGS:String = ".a-a.";
		public static const SEP_MSGS:String = ".m-m.";
		
		public static function collAsString(aColl:ArrayCollection):String
		{
			var result:String = "";
	
			if (aColl != null)
			{
				result += "[";
				for (var i:int; i < aColl.length; i++)
				{
					if (i != 0)
					{
						result += ", ";
					}
					result += aColl.getItemAt(i);
				}
				result += "]";
			} else
			{
				result = "null";
			}
	
			return result;
		}

		public static function arrayAsString(aColl:Array):String
		{
			var result:String = "";
	
			if (aColl != null)
			{
				result += "[";
				for (var i:int; i < aColl.length; i++)
				{
					if (i != 0)
					{
						result += ", ";
					}
					result += aColl[i];
				}
				result += "]";
			} else
			{
				result = "null";
			}
	
			return result;
		}
			
		public static function printDate(aDate:Date):String
		{
			var df:DateFormatter;
			
			df = new DateFormatter();
			df.formatString = "DD/MM/YYYY";
			
			return df.format(aDate);
		}
		
		public static function printDateTime(aDate:Date):String
		{
			var df:DateFormatter;
			
			df = new DateFormatter();
			df.formatString = "DD/MM/YYYY JJ:NN:SS";
			
			return df.format(aDate);
		}
	}
}